<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="/module/bootstrap-3.4.1/css/bootstrap-theme.min.css">
    <link rel="stylesheet" href="/module/bootstrap-3.4.1/css/bootstrap.min.css">
    <link rel="stylesheet" href="/font/font-awesome-4.7.0/css/font-awesome.css">
    <link rel="stylesheet" href="/css/common.css">
    <title>积分</title>
</head>
<body>
    <div id="warp">
        <div class="left">
            <div class="sidebar">
                <div class="navbar navbar-default" id="mycollapse">
                    <!-- <ul class="nav navbar-nav nav-pills nav-stacked"> -->
                    <ul class="nav nav-pills nav-stacked">
                        <li><a href="/index"><i class="fa fa-dashboard fa-fw"></i>首页</a></li>
                        <li><a href="/user"><i class="fa fa-address-card fa-fw"></i>用户</a></li>
                        <li><a href="/subscribe"><i class="fa fa-calendar-times-o fa-fw"></i>预约</a></li>
                        <li><a href="/activity "><i class="fa fa-ship fa-fw"></i>活动</a></li>
                        <li class="active"><a href="/integral "><i class="fa fa-line-chart fa-fw"></i>积分</a></li>
                        <li><a href="/opinion"><i class="fa fa-pencil-square fa-fw"></i>意见</a></li>
                        <li><a href="/goods"><i class="fa fa-shopping-cart fa-fw"></i>商品</a></li>
                        <li><a href="/graph"><i class="fa fa-picture-o fa-fw"></i>轮播图</a></li>
                        <li><a href="/scan"><i class="fa fa-header fa-fw"></i>扫描记录</a></li>
                        <li><a href="/classify"><i class="fa fa-shekel fa-fw"></i>分类</a></li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="right">
            <ol class="breadcrumb">
                <li class="active">积分</li>
            </ol>
            <div class="content">
                <div class="panel panel-default">
                    <!-- Default panel contents -->
                    <div class="panel-heading">积分列表</div>
                    <!-- Table -->
                    <table class="table table-bordered table-hover">
                        <tr>
                            <th>用户名称</th>
                            <th>类型</th>
                            <th>信息</th>
                            <th>分数</th>
                            <th>时间</th>
                        </tr>
                        <tr v-for="(item,index) in integralList">
                            <td>{{item.nickName}}</td>
                            <td>{{item.type}}</td>
                            <td>{{item.message}}</td>
                            <td>{{item.record}}</td>
                            <td>{{item.time.split('T')[0]}}</td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
    </div>

    <script src="/js/jquery.min.js"></script>
    <script src="/module/bootstrap-3.4.1/js/bootstrap.min.js"></script>
    <script src="/js/vue.js"></script>
    <script src="/js/axios.min.js"></script>
     <script>
         const app = new Vue({
             el: '#warp',
             data: {
                integralList: []
             },
             created() {
                 axios.get('/request/getIntegral').then(res => {
                    if (res.status === 200 && res.data.code === 200) {
                        this.integralList = res.data.integralList
                    }else {
                        alert('请求积分列表失败')
                    }
                 })
             }
         })
     </script>
</body>
</html>